package com.lab303.powerproject.controller;

import com.lab303.powerproject.entity.Remain;
import com.lab303.powerproject.repository.RemainRepository;
import com.lab303.powerproject.repository.TemperatureRepository;
import com.lab303.powerproject.service.ColdStrategyService;
import com.lab303.powerproject.service.PredictDataService;
import com.lab303.powerproject.util.ColdStrategy;
import com.lab303.powerproject.util.StrategyGenerator;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.PropertySource;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import java.io.IOException;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.Map;

@Controller
public class ProductStrategyController {
    @Autowired
    private StrategyGenerator sg;

    @Autowired
    private PredictDataService pd;

    @Autowired
    private RemainRepository remainRepository;

    @Autowired
    private ColdStrategyService coldStrategyService;


    /**
     * 策略生成接口，调用可查看策略
     * @return
     * @throws IOException
     * @throws ParseException
     */
    @GetMapping("/gen")
    @ResponseBody
    private Map gen() throws IOException, ParseException {
        Map res = coldStrategyService.strategy();
        return res;
    }


}
